XML (extensible Markup Language) defines a standard language-independent textual format for representing data. On the other hand, object-oriented languages such as Java™ (a trademark of Sun Microsystems), as well as other object-oriented languages such as those offered by Microsoft and Hewlett-Packard, represent data through objects and object models. An application object model or business object model represents an application's data through modelling the real-world domain objects of the application.
Using XML data in an object-oriented application through an application object model would be advantageous. However, the formats of XML data and object-oriented language are distinct. XML represents data as a plain text document composed of a series of elements in a hierarchical format whereas objects in an object-oriented application are composed of a rich set of data-types, pointers, application rules/methods, inheritance and relationships to other objects.
XML parsers, such as Xerces™ (a trademark of Apache), provide a prior solution for reading in and parsing XML data into Java. However, XML parsers only provide a mechanism for reading and parsing XML data into Java. For example, Simple API for XML (SAX) based parsers only produce a series of parse events. Document Object Model (DOM) based parsers only produce a parse tree representation of the data. These parsers do not provide application object models or provide support for inheritance or relationships in the object model.
It is therefore desirable to provide a method and system for mapping data in a markup language document to an object model as well as for mapping an object in an object model to a markup language document.